package com.fanjun.learning.file.csv;


import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

import org.apache.commons.csv.*;

/**
 * Created by memedai on 2016/12/30.
 */
public class CSVFileTest {

    public static void main(String[] args) throws IOException {
        Reader in = new FileReader("E:\\testCsv.csv");
        Iterable<CSVRecord> records = CSVFormat.EXCEL.parse(in);
        for (CSVRecord record : records) {
            String lastName = record.get(1);
            String firstName = record.get(0);
            System.out.println(firstName + ":" + lastName);
        }

    }

}
